import React from 'react';
import CopyBoard from '../../../components/CopyBoard';
import Helper from '../../../components/Helper';

import s from './style.module.css';
import SvgIcon from './icon';
import { Link } from 'react-router-dom';
import ChangeJob from './ChangeJob';
import fetchFer from 'API/fetch';
import notification from '@kuiper-components/notification';
import Tooltip from '@kuiper-components/tooltip';
import cn from 'classnames';
import Tag from '@knownsec/react-component/dist/Tag';
import Icon from '@knownsec/react-component/dist/Icon';
import moment from 'moment';
import { datetime } from '../../../../common/formatter';
import EventCount from '../../Task/TaskInfo/taskTable/EventCount';
const checkType = {
	a: { type: '访问正常', color: '#6AAC42' },
	b: { type: '未知', color: '#9B9B9B' },
	c: { type: '访问异常', color: '#D0021B' },
};
const gradeColor = ['#d81e07', '#F5A623', '#F8E71C', '#9B9B9B', '#6AAC42'];
const hostGrade = {
	严重: {
		color: '#A00000',
		index: '1',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="页面-1"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="监测列表（未选中删除）"
						transform="translate(-422.000000, -735.000000)"
					>
						<g id="严重" transform="translate(418.000000, 732.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M13.5288736,6.70675729 L12.40214,10.9117842 L15.2764098,10.9117842 L10.8876541,16.5639227 L12.0583799,12.1947145 L8.78863016,12.1947145 L13.5288736,6.70675729 Z"
								id="合并形状"
								fill="#A00000"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	高危: {
		color: '#E01010',
		index: '2',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="页面-1"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="监测列表（未选中删除）"
						transform="translate(-462.000000, -735.000000)"
					>
						<g id="高危" transform="translate(458.000000, 732.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M13.5288736,6.70675729 L12.40214,10.9117842 L15.2764098,10.9117842 L10.8876541,16.5639227 L12.0583799,12.1947145 L8.78863016,12.1947145 L13.5288736,6.70675729 Z"
								id="合并形状"
								fill="#E01010"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	中危: {
		color: '#F5A623',
		index: '3',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="页面-1"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="监测列表（未选中删除）"
						transform="translate(-502.000000, -735.000000)"
					>
						<g id="中危" transform="translate(498.000000, 732.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M13.5288736,6.70675729 L12.40214,10.9117842 L15.2764098,10.9117842 L10.8876541,16.5639227 L12.0583799,12.1947145 L8.78863016,12.1947145 L13.5288736,6.70675729 Z"
								id="合并形状"
								fill="#F5A623"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	低危: {
		color: '#F8E71C',
		index: '4',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="页面-1"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="监测列表（未选中删除）"
						transform="translate(-542.000000, -735.000000)"
					>
						<g id="低危" transform="translate(538.000000, 732.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M13.5288736,6.70675729 L12.40214,10.9117842 L15.2764098,10.9117842 L10.8876541,16.5639227 L12.0583799,12.1947145 L8.78863016,12.1947145 L13.5288736,6.70675729 Z"
								id="合并形状"
								fill="#F8E71C"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	未知: {
		color: '#9B9B9B',
		index: '5',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="任务类型+监测情况"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g id="画板" transform="translate(-17.000000, -7.000000)">
						<g id="未知" transform="translate(13.000000, 4.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M13.5288736,6.70675729 L12.40214,10.9117842 L15.2764098,10.9117842 L10.8876541,16.5639227 L12.0583799,12.1947145 L8.78863016,12.1947145 L13.5288736,6.70675729 Z"
								id="合并形状"
								fill="#999EA8"
								fillRule="nonzero"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	安全: {
		color: '#11AB4E',
		index: '6',
		icon: (
			<svg
				className={cn('vam')}
				width="16px"
				height="18px"
				viewBox="0 0 16 18"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<title></title>
				<desc>Created with Sketch.</desc>
				<g
					id="页面-1"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="监测列表（未选中删除）"
						transform="translate(-582.000000, -735.000000)"
					>
						<g id="安全" transform="translate(578.000000, 732.000000)">
							<path
								d="M12.7138991,3.17559818 C13.7484151,3.7256968 14.7604496,4.10192803 15.7500025,4.30429187 C16.4699031,4.45151175 17.2017023,4.51157751 17.9454,4.48448916 C18.7732796,4.45433173 19.4688539,5.10101571 19.4990085,5.92889542 C19.4996711,5.94708778 19.5,5.9652907 19.5,5.98349512 L19.5,12.1207056 C19.5,14.8341751 18.0765503,17.3487523 15.7500025,18.7452093 L12.7719609,20.5327105 C12.2968307,20.8178965 11.7031742,20.8178965 11.2280441,20.5327105 L8.25000249,18.7452093 C5.92345469,17.3487523 4.5,14.8341751 4.5,12.1207056 L4.5,5.99533948 C4.5,5.16691098 5.17157399,4.49533699 6,4.49533699 C6.01685409,4.49533699 6.03370449,4.49562096 6.05054651,4.49618879 C6.77228116,4.52052215 7.50543315,4.45655651 8.25000249,4.30429187 C9.28759463,4.09210399 10.3030146,3.71751031 11.2962624,3.18051085 C11.7381697,2.94158071 12.2703444,2.93974029 12.7138991,3.17559818 Z M12.0096551,4.50000012 C10.8889314,5.1059266 9.73478325,5.53169782 8.55053313,5.7738773 C7.69195656,5.94945645 6.84107388,6.02369379 6.00000249,5.99533699 L6.00000249,12.1207056 C6.00000249,14.3073701 7.14709937,16.3337561 9.02196086,17.4590988 L12.0000025,19.2466 L14.9780441,17.4590988 C16.8529056,16.3337561 18.0000025,14.3073701 18.0000025,12.1207056 L18.0000025,5.98349512 C17.1375565,6.01490865 16.2865368,5.94505732 15.4494719,5.7738773 C14.3134225,5.54155488 13.1666976,5.11525153 12.0096551,4.50000012 Z M15.5073663,8.05815221 L16.5680264,9.11881238 L11.2647256,14.4221132 L8.08274505,11.2401327 L9.14340523,10.1794726 L11.2647451,12.3011522 L15.5073663,8.05815221 Z"
								id="合并形状"
								fill="#11AB4E"
							></path>
							<rect id="矩形-copy-55" x="0" y="0" width="24" height="24"></rect>
						</g>
					</g>
				</g>
			</svg>
		),
	},
};
export const webGrade = {
	严重: {
		color: '#A00000',
		index: '1',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-693.000000, -906.000000)"
						fill="#D5342F"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="告警记录" transform="translate(0.000000, 252.000000)">
								<path
									d="M12.044442,13.3452341 C12.5342511,13.3452341 12.9313198,13.7423029 12.9313198,14.232112 C12.9313198,14.7219211 12.5342511,15.1189898 12.044442,15.1189898 L1.40190807,15.1189898 C0.912098975,15.1189898 0.515030247,14.7219211 0.515030247,14.232112 C0.515030247,13.7423029 0.912098975,13.3452341 1.40190807,13.3452341 L12.044442,13.3452341 Z M6.72317502,3.58957805 C9.66202961,3.58957805 12.044442,5.97199042 12.044442,8.910845 L12.044442,12.4583563 L1.40190807,12.4583563 L1.40190807,8.910845 C1.40190807,5.97199042 3.78432044,3.58957805 6.72317502,3.58957805 L6.72317502,3.58957805 Z M7.61005285,5.3633337 L4.94941937,8.02396718 L6.27973611,8.02396718 L5.8362972,10.6846007 L8.49693067,8.02396718 L7.16661394,8.0230803 L7.61005285,5.3633337 Z M0.690632057,3.18161425 L0.761582283,3.22063688 L2.09189902,4.1075147 C2.28321601,4.23468651 2.34573221,4.4869146 2.23595285,4.68871488 C2.1261735,4.89051516 1.88045183,4.97506185 1.66974518,4.8835328 L1.59879495,4.84539705 L0.268478212,3.95851923 C0.0771612186,3.83134742 0.0146450237,3.57911933 0.124424377,3.37731905 C0.234203731,3.17551876 0.479925406,3.09097207 0.690632057,3.18250113 L0.690632057,3.18161425 Z M13.300261,3.34391289 C13.4187765,3.52188128 13.3934159,3.75907822 13.2399533,3.90796719 L13.1778718,3.95851923 L11.8475551,4.84539705 L11.7766049,4.8835328 C11.5800962,4.96814058 11.3511967,4.90037422 11.2324188,4.72242491 C11.1136409,4.5444756 11.1388578,4.30709119 11.2923696,4.15806674 L11.354451,4.1075147 L12.6847678,3.22063688 L12.755718,3.18250113 C12.9523949,3.0977523 13.181538,3.16567419 13.300261,3.34391289 L13.300261,3.34391289 Z M3.49493974,1.06463688 L3.5446049,1.12671833 L4.43148272,2.45703507 C4.55784216,2.64781947 4.51827636,2.90342287 4.34014831,3.04707452 C4.16202027,3.19072617 3.90383655,3.17524335 3.74415241,3.01133371 L3.69360037,2.94925226 L2.80672255,1.61893552 C2.67562046,1.42796613 2.71359236,1.16826405 2.89388194,1.02282426 C3.07417152,0.877384475 3.33602861,0.8952142 3.49493974,1.06375001 L3.49493974,1.06463688 Z M10.5163515,1.00344231 C10.6945902,1.12216527 10.7625121,1.35130838 10.6777632,1.5479853 L10.6396275,1.61893552 L9.75274967,2.94925226 L9.70308452,3.01133371 C9.55460228,3.16755538 9.31529448,3.1943921 9.13589731,3.07493984 C8.95650014,2.95548758 8.8889707,2.72434216 8.9758447,2.52709842 L9.01486732,2.45614819 L9.90174515,1.12583145 L9.95229718,1.06375001 C10.1011862,0.910287438 10.3383831,0.884926758 10.5163515,1.00344231 L10.5163515,1.00344231 Z M6.72317502,0.0420667263 C6.9373492,0.0419953499 7.12096757,0.195010661 7.15951891,0.40568666 L7.1666147,0.485505664 L7.1666147,2.25926131 C7.16703678,2.48895298 6.99199511,2.68094897 6.76324257,2.70170273 C6.53449003,2.72245649 6.32775286,2.56509769 6.28683113,2.33908032 L6.27973611,2.25926131 L6.27973611,0.485505664 C6.27973611,0.240601115 6.47827047,0.0420667263 6.72317502,0.0420667263 L6.72317502,0.0420667263 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	高危: {
		color: '#E01010',
		index: '2',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-693.000000, -870.000000)"
						fill="#F04038"
						fillRule="nonzero"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="告警记录" transform="translate(0.000000, 216.000000)">
								<path
									d="M12.044442,13.3452341 C12.5342511,13.3452341 12.9313198,13.7423029 12.9313198,14.232112 C12.9313198,14.7219211 12.5342511,15.1189898 12.044442,15.1189898 L1.40190807,15.1189898 C0.912098975,15.1189898 0.515030247,14.7219211 0.515030247,14.232112 C0.515030247,13.7423029 0.912098975,13.3452341 1.40190807,13.3452341 L12.044442,13.3452341 Z M6.72317502,3.58957805 C9.66202961,3.58957805 12.044442,5.97199042 12.044442,8.910845 L12.044442,12.4583563 L1.40190807,12.4583563 L1.40190807,8.910845 C1.40190807,5.97199042 3.78432044,3.58957805 6.72317502,3.58957805 L6.72317502,3.58957805 Z M7.61005285,5.3633337 L4.94941937,8.02396718 L6.27973611,8.02396718 L5.8362972,10.6846007 L8.49693067,8.02396718 L7.16661394,8.0230803 L7.61005285,5.3633337 Z M0.690632057,3.18161425 L0.761582283,3.22063688 L2.09189902,4.1075147 C2.28321601,4.23468651 2.34573221,4.4869146 2.23595285,4.68871488 C2.1261735,4.89051516 1.88045183,4.97506185 1.66974518,4.8835328 L1.59879495,4.84539705 L0.268478212,3.95851923 C0.0771612186,3.83134742 0.0146450237,3.57911933 0.124424377,3.37731905 C0.234203731,3.17551876 0.479925406,3.09097207 0.690632057,3.18250113 L0.690632057,3.18161425 Z M13.300261,3.34391289 C13.4187765,3.52188128 13.3934159,3.75907822 13.2399533,3.90796719 L13.1778718,3.95851923 L11.8475551,4.84539705 L11.7766049,4.8835328 C11.5800962,4.96814058 11.3511967,4.90037422 11.2324188,4.72242491 C11.1136409,4.5444756 11.1388578,4.30709119 11.2923696,4.15806674 L11.354451,4.1075147 L12.6847678,3.22063688 L12.755718,3.18250113 C12.9523949,3.0977523 13.181538,3.16567419 13.300261,3.34391289 L13.300261,3.34391289 Z M3.49493974,1.06463688 L3.5446049,1.12671833 L4.43148272,2.45703507 C4.55784216,2.64781947 4.51827636,2.90342287 4.34014831,3.04707452 C4.16202027,3.19072617 3.90383655,3.17524335 3.74415241,3.01133371 L3.69360037,2.94925226 L2.80672255,1.61893552 C2.67562046,1.42796613 2.71359236,1.16826405 2.89388194,1.02282426 C3.07417152,0.877384475 3.33602861,0.8952142 3.49493974,1.06375001 L3.49493974,1.06463688 Z M10.5163515,1.00344231 C10.6945902,1.12216527 10.7625121,1.35130838 10.6777632,1.5479853 L10.6396275,1.61893552 L9.75274967,2.94925226 L9.70308452,3.01133371 C9.55460228,3.16755538 9.31529448,3.1943921 9.13589731,3.07493984 C8.95650014,2.95548758 8.8889707,2.72434216 8.9758447,2.52709842 L9.01486732,2.45614819 L9.90174515,1.12583145 L9.95229718,1.06375001 C10.1011862,0.910287438 10.3383831,0.884926758 10.5163515,1.00344231 L10.5163515,1.00344231 Z M6.72317502,0.0420667263 C6.9373492,0.0419953499 7.12096757,0.195010661 7.15951891,0.40568666 L7.1666147,0.485505664 L7.1666147,2.25926131 C7.16703678,2.48895298 6.99199511,2.68094897 6.76324257,2.70170273 C6.53449003,2.72245649 6.32775286,2.56509769 6.28683113,2.33908032 L6.27973611,2.25926131 L6.27973611,0.485505664 C6.27973611,0.240601115 6.47827047,0.0420667263 6.72317502,0.0420667263 L6.72317502,0.0420667263 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	中危: {
		color: '#F5A623',
		index: '3',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-693.000000, -767.000000)"
						fill="#F5A92C"
						fillRule="nonzero"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="告警记录" transform="translate(0.070466, 113.042067)">
								<path
									d="M11.9739763,13.3031674 C12.4637854,13.3031674 12.8608541,13.7002362 12.8608541,14.1900453 C12.8608541,14.6798543 12.4637854,15.0769231 11.9739763,15.0769231 L1.33144242,15.0769231 C0.841633319,15.0769231 0.444564592,14.6798543 0.444564592,14.1900453 C0.444564592,13.7002362 0.841633319,13.3031674 1.33144242,13.3031674 L11.9739763,13.3031674 Z M6.65270937,3.54751135 C9.59156395,3.54751135 11.9739763,5.92992371 11.9739763,8.8687783 L11.9739763,12.4162896 L1.33144242,12.4162896 L1.33144242,8.8687783 C1.33144242,5.92992371 3.71385478,3.54751135 6.65270937,3.54751135 L6.65270937,3.54751135 Z M7.53958719,5.321267 L4.87895372,7.98190048 L6.20927045,7.98190048 L5.76583154,10.642534 L8.42646502,7.98190048 L7.09614828,7.9810136 L7.53958719,5.321267 Z M0.620166401,3.13954755 L0.691116627,3.17857018 L2.02143336,4.065448 C2.21275036,4.19261981 2.27526655,4.4448479 2.1654872,4.64664818 C2.05570785,4.84844846 1.80998617,4.93299515 1.59927952,4.8414661 L1.52832929,4.80333035 L0.198012556,3.91645253 C0.00669556286,3.78928072 -0.055820632,3.53705263 0.0539587216,3.33525235 C0.163738075,3.13345206 0.409459751,3.04890537 0.620166401,3.14043443 L0.620166401,3.13954755 Z M13.2297953,3.30184619 C13.3483109,3.47981458 13.3229502,3.71701152 13.1694876,3.86590049 L13.1074062,3.91645253 L11.7770894,4.80333035 L11.7061392,4.8414661 C11.5096305,4.92607388 11.280731,4.85830751 11.1619531,4.68035821 C11.0431752,4.5024089 11.0683922,4.26502448 11.2219039,4.11600004 L11.2839854,4.065448 L12.6143021,3.17857018 L12.6852523,3.14043443 C12.8819293,3.0556856 13.1110724,3.12360749 13.2297953,3.30184619 L13.2297953,3.30184619 Z M3.42447408,1.02257018 L3.47413924,1.08465163 L4.36101707,2.41496837 C4.48737651,2.60575277 4.4478107,2.86135617 4.26968266,3.00500782 C4.09155461,3.14865946 3.8333709,3.13317665 3.67368675,2.96926701 L3.62313472,2.90718556 L2.73625689,1.57686882 C2.60515481,1.38589943 2.64312671,1.12619735 2.82341629,0.980757564 C3.00370587,0.835317774 3.26556295,0.853147499 3.42447408,1.0216833 L3.42447408,1.02257018 Z M10.4458858,0.961375612 C10.6241245,1.08009857 10.6920464,1.30924168 10.6072976,1.5059186 L10.5691618,1.57686882 L9.68228402,2.90718556 L9.63261886,2.96926701 C9.48413662,3.12548868 9.24482883,3.1523254 9.06543166,3.03287314 C8.88603449,2.91342088 8.81850504,2.68227546 8.90537904,2.48503172 L8.94440167,2.41408149 L9.83127949,1.08376475 L9.88183153,1.0216833 C10.0307205,0.868220736 10.2679174,0.842860057 10.4458858,0.961375612 L10.4458858,0.961375612 Z M6.65270937,2.49605057e-08 C6.86688354,-7.13513755e-05 7.05050192,0.152943959 7.08905326,0.363619958 L7.09614904,0.443438962 L7.09614904,2.21719461 C7.09657112,2.44688628 6.92152945,2.63888227 6.69277691,2.65963603 C6.46402437,2.68038979 6.25728721,2.52303099 6.21636548,2.29701362 L6.20927045,2.21719461 L6.20927045,0.443438962 C6.20927045,0.198534414 6.40780482,2.49605057e-08 6.65270937,2.49605057e-08 L6.65270937,2.49605057e-08 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	低危: {
		color: '#F8E71C',
		index: '4',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-693.000000, -826.000000)"
						fill="#FCD94A"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="告警记录" transform="translate(0.000000, 172.000000)">
								<path
									d="M12.044442,13.3452341 C12.5342511,13.3452341 12.9313198,13.7423029 12.9313198,14.232112 C12.9313198,14.7219211 12.5342511,15.1189898 12.044442,15.1189898 L1.40190807,15.1189898 C0.912098975,15.1189898 0.515030247,14.7219211 0.515030247,14.232112 C0.515030247,13.7423029 0.912098975,13.3452341 1.40190807,13.3452341 L12.044442,13.3452341 Z M6.72317502,3.58957805 C9.66202961,3.58957805 12.044442,5.97199042 12.044442,8.910845 L12.044442,12.4583563 L1.40190807,12.4583563 L1.40190807,8.910845 C1.40190807,5.97199042 3.78432044,3.58957805 6.72317502,3.58957805 L6.72317502,3.58957805 Z M7.61005285,5.3633337 L4.94941937,8.02396718 L6.27973611,8.02396718 L5.8362972,10.6846007 L8.49693067,8.02396718 L7.16661394,8.0230803 L7.61005285,5.3633337 Z M0.690632057,3.18161425 L0.761582283,3.22063688 L2.09189902,4.1075147 C2.28321601,4.23468651 2.34573221,4.4869146 2.23595285,4.68871488 C2.1261735,4.89051516 1.88045183,4.97506185 1.66974518,4.8835328 L1.59879495,4.84539705 L0.268478212,3.95851923 C0.0771612186,3.83134742 0.0146450237,3.57911933 0.124424377,3.37731905 C0.234203731,3.17551876 0.479925406,3.09097207 0.690632057,3.18250113 L0.690632057,3.18161425 Z M13.300261,3.34391289 C13.4187765,3.52188128 13.3934159,3.75907822 13.2399533,3.90796719 L13.1778718,3.95851923 L11.8475551,4.84539705 L11.7766049,4.8835328 C11.5800962,4.96814058 11.3511967,4.90037422 11.2324188,4.72242491 C11.1136409,4.5444756 11.1388578,4.30709119 11.2923696,4.15806674 L11.354451,4.1075147 L12.6847678,3.22063688 L12.755718,3.18250113 C12.9523949,3.0977523 13.181538,3.16567419 13.300261,3.34391289 L13.300261,3.34391289 Z M3.49493974,1.06463688 L3.5446049,1.12671833 L4.43148272,2.45703507 C4.55784216,2.64781947 4.51827636,2.90342287 4.34014831,3.04707452 C4.16202027,3.19072617 3.90383655,3.17524335 3.74415241,3.01133371 L3.69360037,2.94925226 L2.80672255,1.61893552 C2.67562046,1.42796613 2.71359236,1.16826405 2.89388194,1.02282426 C3.07417152,0.877384475 3.33602861,0.8952142 3.49493974,1.06375001 L3.49493974,1.06463688 Z M10.5163515,1.00344231 C10.6945902,1.12216527 10.7625121,1.35130838 10.6777632,1.5479853 L10.6396275,1.61893552 L9.75274967,2.94925226 L9.70308452,3.01133371 C9.55460228,3.16755538 9.31529448,3.1943921 9.13589731,3.07493984 C8.95650014,2.95548758 8.8889707,2.72434216 8.9758447,2.52709842 L9.01486732,2.45614819 L9.90174515,1.12583145 L9.95229718,1.06375001 C10.1011862,0.910287438 10.3383831,0.884926758 10.5163515,1.00344231 L10.5163515,1.00344231 Z M6.72317502,0.0420667263 C6.9373492,0.0419953499 7.12096757,0.195010661 7.15951891,0.40568666 L7.1666147,0.485505664 L7.1666147,2.25926131 C7.16703678,2.48895298 6.99199511,2.68094897 6.76324257,2.70170273 C6.53449003,2.72245649 6.32775286,2.56509769 6.28683113,2.33908032 L6.27973611,2.25926131 L6.27973611,0.485505664 C6.27973611,0.240601115 6.47827047,0.0420667263 6.72317502,0.0420667263 L6.72317502,0.0420667263 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	未知: {
		color: '#9B9B9B',
		index: '5',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-693.000000, -716.000000)"
						fill="#9B9B9B"
						fillRule="nonzero"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="告警记录" transform="translate(0.000000, 62.000000)">
								<path
									d="M12.044442,13.3452341 C12.5342511,13.3452341 12.9313198,13.7423029 12.9313198,14.232112 C12.9313198,14.7219211 12.5342511,15.1189898 12.044442,15.1189898 L1.40190807,15.1189898 C0.912098975,15.1189898 0.515030247,14.7219211 0.515030247,14.232112 C0.515030247,13.7423029 0.912098975,13.3452341 1.40190807,13.3452341 L12.044442,13.3452341 Z M6.72317502,3.58957805 C9.66202961,3.58957805 12.044442,5.97199042 12.044442,8.910845 L12.044442,12.4583563 L1.40190807,12.4583563 L1.40190807,8.910845 C1.40190807,5.97199042 3.78432044,3.58957805 6.72317502,3.58957805 L6.72317502,3.58957805 Z M7.61005285,5.3633337 L4.94941937,8.02396718 L6.27973611,8.02396718 L5.8362972,10.6846007 L8.49693067,8.02396718 L7.16661394,8.0230803 L7.61005285,5.3633337 Z M0.690632057,3.18161425 L0.761582283,3.22063688 L2.09189902,4.1075147 C2.28321601,4.23468651 2.34573221,4.4869146 2.23595285,4.68871488 C2.1261735,4.89051516 1.88045183,4.97506185 1.66974518,4.8835328 L1.59879495,4.84539705 L0.268478212,3.95851923 C0.0771612186,3.83134742 0.0146450237,3.57911933 0.124424377,3.37731905 C0.234203731,3.17551876 0.479925406,3.09097207 0.690632057,3.18250113 L0.690632057,3.18161425 Z M13.300261,3.34391289 C13.4187765,3.52188128 13.3934159,3.75907822 13.2399533,3.90796719 L13.1778718,3.95851923 L11.8475551,4.84539705 L11.7766049,4.8835328 C11.5800962,4.96814058 11.3511967,4.90037422 11.2324188,4.72242491 C11.1136409,4.5444756 11.1388578,4.30709119 11.2923696,4.15806674 L11.354451,4.1075147 L12.6847678,3.22063688 L12.755718,3.18250113 C12.9523949,3.0977523 13.181538,3.16567419 13.300261,3.34391289 L13.300261,3.34391289 Z M3.49493974,1.06463688 L3.5446049,1.12671833 L4.43148272,2.45703507 C4.55784216,2.64781947 4.51827636,2.90342287 4.34014831,3.04707452 C4.16202027,3.19072617 3.90383655,3.17524335 3.74415241,3.01133371 L3.69360037,2.94925226 L2.80672255,1.61893552 C2.67562046,1.42796613 2.71359236,1.16826405 2.89388194,1.02282426 C3.07417152,0.877384475 3.33602861,0.8952142 3.49493974,1.06375001 L3.49493974,1.06463688 Z M10.5163515,1.00344231 C10.6945902,1.12216527 10.7625121,1.35130838 10.6777632,1.5479853 L10.6396275,1.61893552 L9.75274967,2.94925226 L9.70308452,3.01133371 C9.55460228,3.16755538 9.31529448,3.1943921 9.13589731,3.07493984 C8.95650014,2.95548758 8.8889707,2.72434216 8.9758447,2.52709842 L9.01486732,2.45614819 L9.90174515,1.12583145 L9.95229718,1.06375001 C10.1011862,0.910287438 10.3383831,0.884926758 10.5163515,1.00344231 L10.5163515,1.00344231 Z M6.72317502,0.0420667263 C6.9373492,0.0419953499 7.12096757,0.195010661 7.15951891,0.40568666 L7.1666147,0.485505664 L7.1666147,2.25926131 C7.16703678,2.48895298 6.99199511,2.68094897 6.76324257,2.70170273 C6.53449003,2.72245649 6.32775286,2.56509769 6.28683113,2.33908032 L6.27973611,2.25926131 L6.27973611,0.485505664 C6.27973611,0.240601115 6.47827047,0.0420667263 6.72317502,0.0420667263 L6.72317502,0.0420667263 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
	安全: {
		color: '#11AB4E',
		index: '6',
		icon: (
			<svg
				className={cn('vam')}
				width="14px"
				height="16px"
				viewBox="0 0 14 16"
				version="1.1"
				xmlns="http://www.w3.org/2000/svg"
				xmlnsXlink="http://www.w3.org/1999/xlink"
			>
				<g
					id="资产"
					stroke="none"
					strokeWidth="1"
					fill="none"
					fillRule="evenodd"
				>
					<g
						id="Web资产列表"
						transform="translate(-694.000000, -658.000000)"
						fill="#11AB4E"
						fillRule="nonzero"
					>
						<g id="编组-2" transform="translate(693.000000, 654.000000)">
							<g id="09安全、保障" transform="translate(1.000000, 4.000000)">
								<path
									d="M6.73076923,0.00355113636 L0.0152972028,2.90127841 L0.0152972028,7.24786932 C0.0152972028,11.2677557 2.87587413,15.0177557 6.73076923,15.9410511 C10.5856643,15.0319602 13.4462413,11.2677557 13.4462413,7.24786932 L13.4462413,2.90127841 L6.73076923,0.00355113636 Z M6.5777972,10.2024148 L5.70585664,11.0120739 L4.83391608,10.2024148 L3.10533217,8.59730114 L3.97727273,7.78764205 L5.70585664,9.39275568 L9.60664336,5.77059659 L10.4785839,6.58025568 L6.5777972,10.2024148 Z"
									id="形状"
								></path>
							</g>
						</g>
					</g>
				</g>
			</svg>
		),
	},
};

const handleUpdateJobNote = async record => {
	const updateData = {
		note: record.note,
		jobId: record.jobId,
	};
	return await fetchFer(`/api/v2/asset/asset-update`, {
		method: 'POST',
		body: JSON.stringify(updateData),
	}).catch(error => {
		return error;
	});
};
export const HostColumns = [
	{
		title: '资产名称',
		dataIndex: 'note',
		key: 'note',
		render(e) {
			return (
				<div className={s.ell} title={e}>
					<CopyBoard text={e} />
				</div>
			);
		},
	},
	{
		title: '资产地址',
		dataIndex: 'target_url',
		key: 'target_url',
		render(e) {
			return (
				<div className={s.ell} title={e}>
					<CopyBoard text={e} />
				</div>
			);
		},
	},
	// {
	// 	title: '操作系统',
	// 	dataIndex: 'note',
	// 	key: 'note',
	// 	render(_, record) {
	// 		return (
	// 			<div className={s.ell} title={record.note}>
	// 				{record.note}
	// 			</div>
	// 		);
	// 	},
	// },
	{
		title: '威胁等级',
		dataIndex: 'level',
		key: 'level',
		render(e, row) {
			return (
				<Tooltip
					placement="top"
					// trigger={['click']}
					overlay={`监测完成时间：${datetime(row.update_time) || '- -'}`}>
					<div className={cn('dib')}>
						{webGrade[e].icon}
						<span className={cn('dib vam ml8')} style={{ color: webGrade[e].color }}>
							{e}
						</span>
					</div>
				</Tooltip>
			);
		},
	},
	// {
	// 	title: '存活状态',
	// 	dataIndex: 'alive_status',
	// 	key: 'alive_status',
	// 	render(e, record) {
	// 		e = 'a';
	// 		return (
	// 			<div>
	// 				<span
	// 					className={s.circle}
	// 					style={{ background: checkType[e].color }}
	// 				></span>
	// 				<span>{checkType[e].type}</span>
	// 			</div>
	// 		);
	// 	},
	// },
	{
		title: '最近一次监测结果',
		key: 'detail2',
		dataIndex: 'detail',
		width: 240,
		render(e, row) {
			return <EventCount className={s.lh1} noTime={true} row={{...row, detail: { vul: {...row?.last_result, middle: row?.last_result?.medium } }}} />;
		},
	},
	// {
	// 	title: '认证状态',
	// 	dataIndex: 'is_verified',
	// 	key: 'is_verified',
	// 	render(e, record) {
	// 		return (
	// 			<Tooltip
	// 				trigger={['hover']}
	// 				placement="top"
	// 				overlay={e ? '已认证' : '未认证，请联系技术支持人员认证资产。'}
	// 			>
	// 				<span style={{ cursor: 'pointer', paddingLeft: '20px' }}>
	// 					<SvgIcon active={e ? 6 : 7} />
	// 				</span>
	// 			</Tooltip>
	// 		);
	// 	},
	// },
];

export const WebColumns = [
	{
		title: '资产名称',
		dataIndex: 'note',
		key: 'note',
		render(e) {
			return (
				<div className={s.ell} title={e}>
					<CopyBoard text={e} />
				</div>
			);
		},
	},
	{
		title: '资产地址',
		dataIndex: 'target_url',
		key: 'target_url',
		render(e) {
			return (
				<div className={s.subDb} title={e}>
					<CopyBoard text={e} />
				</div>
			);
		},
	},
	{
		title: '源站IP',
		dataIndex: 'source_ip',
		key: 'source_ip',
		render(e) {
			return (
				<div className={s.ell} title={e}>
					{e ? <CopyBoard text={e} /> : '- -'}
				</div>
			);
		},
	},
	{
		title: '风险等级',
		dataIndex: 'level',
		key: 'level',
		width: 120,
		render(e, row) {
			return (
				<Tooltip
					placement="top"
					overlay={`监测完成时间：${
						row.update_time
							? moment(row.update_time).format('YYYY-MM-DD HH:mm:ss')
							: '- -'
					}`}
				>
					<span className={cn('dib')}>
						{webGrade[e].icon}
						<span className={cn('dib vam ml8')} style={{ color: webGrade[e].color }}>
							{e}
						</span>
					</span>
				</Tooltip>
			);
		},
	},
	{
		title: '最近一次监测结果',
		key: 'taskRes',
		width: 300,
		dataIndex: 'taskRes',
		render(e, row) {
			return e(row)
		},
	},
];
